package com.akk.module.avs.service;

import com.akk.module.avs.entity.SynthesisFinancial;
import com.akk.module.avs.entity.SynthesisFinancialExample;
import com.akk.module.avs.mapper.SynthesisFinancialMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.StringUtils;

import java.util.List;

/**
 * 直销银行
 */
@Service
public class SynthesisFinancialService {

    @Autowired
    private SynthesisFinancialMapper synthesisFinancialMapper;

    @Autowired
    private SynthesisFinancialExample synthesisFinancialExample;

    public List<SynthesisFinancial> findByAppIdAndStatus(String appId) {
        synthesisFinancialExample.createCriteria().andAppIdEqualTo(appId).andSfStatusEqualTo("Y");
        return synthesisFinancialMapper.selectByExample(synthesisFinancialExample);
    }

    public List<SynthesisFinancial> findByAppId(String appId) {
        synthesisFinancialExample.createCriteria().andAppIdEqualTo(appId);
        return synthesisFinancialMapper.selectByExample(synthesisFinancialExample);
    }

    public void insert(SynthesisFinancial synthesisFinancial) {
        synthesisFinancialMapper.insert(synthesisFinancial);
    }

    public void update(SynthesisFinancial synthesisFinancial) {
        synthesisFinancialMapper.updateByPrimaryKey(synthesisFinancial);
    }

    public SynthesisFinancial findById(Integer id) {
        return synthesisFinancialMapper.selectByPrimaryKey(id);
    }
}
